﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfForgotPassword.aspx.cs" Inherits="msBsc.WebUi.mMall.Public.mfForgotPassword" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客商城</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/public/mLogin.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/home/base.css" charset="gbk" />
    <%=getBodyBeforeJs()%>
    <script src="/??jqPlugin/js/jquery-1.8.3.min.js,js/jBase.js,js/jmPage.js,themes/Style1/jsQt.js,jqPlugin/js/laytpl.js,themes/wStyle1/js/comm/VerifyJs.js"
        type="text/javascript"></script>
    <script type="text/javascript">
        $(window).load(function () {
        });
        //        $(window).bind('resize', function () { _self._ResizeHandler(_self); })
        //        .bind('scroll', function () { _self._ResizeHandler(_self); });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
        .btn {
            background: #0a7fc6 !important;
        }
    </style>
    <base target="_self" />
</head>
<body>
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(false) %>
        <form action='#' method="post" id="J_EmailForm">

            <div class="password_box" style="width: 100%;">
                <div class="password">
                    <div class="kv_list">
                        <div class="c_input">
                            <div class="c_text">
                                <input type="text" value="" name="username" id="J_username_input" placeholder="请输入您的账户名" />
                                <a class="input_pwd"></a>
                            </div>
                        </div>
                        <div class="c_input">
                            <div class="c_text">
                                <input type="text" value="" name="username" id="J_checkcode_input" class="v_input" maxlength="4" style="padding-right: 0px !important;" placeholder="请输入验证码" />
                            </div>
                            <div class="c_code">
                                <div id="imgValidata" class="img_code" style=""></div>
                            </div>
                        </div>

                        <div>
                            <input type="button" class="btn btn-large btn_size" id="J_BtnEmailForm" onclick="Accounts(0, this)" value="下一步" />
                        </div>
                    </div>
                    <div class="kv_list" style="display: none;">
                        <div class="c_input">
                            <div class="c_text">
                                <input type="text" value="" name="username" id="J_useremail_input" placeholder="" />
                            </div>
                        </div>
                         <div>
                            <input type="button" class="btn btn-large btn_size" id="J_btn_phone_code" onclick="SendEmail()" style="background:#69cd38 !important;" value="免费获取重置路径" />
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <script type="text/javascript">
            (function () {
                $("#h_title").text("找回密码");
                jQuery.getValidateImg('imgValidata');

                $("#J_username_input").val("");
                $("#J_checkcode_input").val("");
                $("#J_useremail_input").val("");
                $("#J_emailcode_input").val("");
                $("#J_username_input").live("focus", function () {
                    $("#J_username_ph").hide();
                });
                $("#J_username_input").live("blur", function () {
                    if (IsNull($(this).val())) {
                        $("#J_username_ph").show();
                    }
                })
            })()
            var userCode = "", userName = "";
            function btnDo(sEbtn) {
                GtGrid1Action = sEbtn;
                var opart = new jsonRow();
                opart.AddCell("ACTION", GtGrid1Action);
                if (sEbtn == "userCode") {
                    opart.AddCell("Code", userCode);
                    opart.AddCell("userName", userName);
                }
                ajaxComm(opart);
            };

            function firstNext(index) {
                $(".num4 li").eq(index).removeClass("current");
                $(".num4 li").eq(index).addClass("done");
                $(".num4 li").eq(index + 1).addClass("current");
                $(".kv_list").hide();
                $(".kv_list").eq(index + 1).show();
            }

            function Accounts() {
                userName = $("#J_username_input").val();
                if (!vfcUser(userName)) {
                    return;
                }
                userCode = $("#J_checkcode_input").val();
                if (!vfcCode(userCode)) {
                    return;
                }
                btnDo("userCode");
            }

            function SendEmail() {
                if ($("#J_btn_phone_code").val() == "正在发送邮件") {
                    return;
                }
                var account = $("#J_username_input").val();
                var email = $("#J_useremail_input").val();
                var btnValue = $("#J_btn_phone_code").val();
                var opart = new jsonRow();
                $("#J_btn_phone_code").val("正在发送邮件");
                opart.AddCell("ACTION", "sendEmail");
                opart.AddCell("account", account);
                opart.AddCell("email", email);
                opart.AddCell("btnValue", btnValue);
                ajaxComm(opart);
            }



            //验证用户名
            function vfcUser(UserNameStr) {
                if (IsNull(UserNameStr)) {
                    alert("账户名不能为空");
                    return false;
                }
                if (!IsEmail(UserNameStr)) {
                    alert("账户名只能是邮箱");
                    return false;
                }
                return true;
            }



            //验证验证码
            function vfcCode(ValidataCode) {
                if (ValidataCode.length != 4) {
                    alert("验证码长度只能是四位");
                    return false;
                }
                if (!isStr(ValidataCode)) {
                    alert("验证码只能是数字和字母组合");
                    return false;
                }
                return true;
            }
        </script>
    </div>
</body>
<%=getBodyAfterJs() %>
</html>
